
public class BoxMap {
	static Box[][] boxMatrix;
	static BoxMap boxMap; 
	
	private BoxMap() {
		StaticMap s = StaticMap.getStaticMap();
		boxMatrix = new Box[s.boardW][s.boardH];
		
		for (int i=0 ; i<s.boardW ; i++) {
			for (int j=0 ; j<s.boardH ; j++) {
				if (true||s.isTileEmpty(i, j)) {
					boxMatrix[i][j] = new Box(new Coord(i,j));
				} else {
					boxMatrix[i][j] = null;
				}
			}
		}
	}
	
	public static Box getBox(Coord c) {
		if (boxMap == null) boxMap = new BoxMap();
		
		return boxMatrix[c.x][c.y];
	}
	
	public static Box getBox(int x, int y) {
		if (boxMap == null) boxMap = new BoxMap();
		
		return boxMatrix[x][y];
	}
	
	
}
